package com.health.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.health.common.Result;
import com.health.entity.User;
import com.health.entity.pojo.dto.BanDTO;
import com.health.entity.pojo.dto.UserDTO;
import com.health.entity.pojo.vo.QueryAdminVO;
import com.health.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author sanchuan
 * @since 2023-04-22
 */
@Api(tags = "用户管理")
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController extends BaseController{
    @Autowired
    private IUserService userService;

    @ApiOperation("获得用户列表分页+条件查询")
    @PostMapping("/listUserPage/{pageNum}/{pageSize}")
    public Result<User> listUserPage(
            @PathVariable("pageNum") Integer pageNum,
            @PathVariable("pageSize") Integer pageSize,
            @RequestBody UserDTO userDTO){
        IPage<User> userIPage = userService.listUserPage(pageNum, pageSize, userDTO);
        return this.dataResult(userIPage);
    }

}
